Skip to content

Coerced some explain tests #1183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2024
Merged

Coerced some explain tests #1183

merged 1 commit into from
May 20, 2024

Conversation

aidanharan
Copy link
Contributor

Fix following tests:

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/9149232428/job/25152652558

 4) Failure:
ExplainTest#test_relation_explain_with_first [/usr/local/bundle/bundler/gems/rails-f31b853267ba/activerecord/test/cases/explain_test.rb:98]:
Expected /EXEC\ sp_executesql\ N'SELECT\ \[cars\]\.\*\ FROM\ \[cars\]\ ORDER\ BY\ \[cars\]\.\[id\]\ ASC\ OFFSET\ 0\ ROWS\ FETCH\ NEXT\ @0\ ROWS\ ONLY',\ N'@0\ int',\ @0\ =\ 1/ to match EXPLAIN for: SELECT [cars].* FROM [cars] ORDER BY [cars].[id] ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY [["LIMIT", 1]]
+----------------------------------------------------+--------+--------+--------+----------------------+----------------------+----------------------------------------------------+----------------------------------------------------+--------------+------------+-------------+------------+------------------+----------------------------------------------------+----------+----------+----------+--------------------+
| StmtText                                           | StmtId | NodeId | Parent | PhysicalOp           | LogicalOp            | Argument                                           | DefinedValues                                      | EstimateRows | EstimateIO | EstimateCPU | AvgRowSize | TotalSubtreeCost | OutputList                                         | Warnings | Type     | Parallel | EstimateExecutions |
+----------------------------------------------------+--------+--------+--------+----------------------+----------------------+----------------------------------------------------+----------------------------------------------------+--------------+------------+-------------+------------+------------------+----------------------------------------------------+----------+----------+----------+--------------------+
| SELECT [cars].* FROM [cars] ORDER BY [cars].[id... | 1      | 1      | 0      | NULL                 | NULL                 | 1                                                  | NULL                                               | 1.0          | NULL       | NULL        | NULL       | 0.00328320       | NULL                                               | NULL     | SELECT   | false    | NULL               |
|   |--Top(TOP EXPRESSION:((1)))                     | 1      | 2      | 1      | Top                  | Top                  | TOP EXPRESSION:((1))                               | NULL                                               | 1.0          | 0.0        | 1.00000001  | 4072       | 0.00328320       | [activerecord_unittest].[dbo].[cars].[id], [act... | NULL     | PLAN_ROW | false    | 1.0                |
|        |--Clustered Index Scan(OBJECT:([activer... | 1      | 3      | 2      | Clustered Index Scan | Clustered Index Scan | OBJECT:([activerecord_unittest].[dbo].[cars].[P... | [activerecord_unittest].[dbo].[cars].[id], [act... | 1.0          | 0.00312500 | 0.00015920  | 4072       | 0.00328309       | [activerecord_unittest].[dbo].[cars].[id], [act... | NULL     | PLAN_ROW | false    | 1.0                |
+----------------------------------------------------+--------+--------+--------+----------------------+----------------------+----------------------------------------------------+----------------------------------------------------+--------------+------------+-------------+------------+------------------+----------------------------------------------------+----------+----------+----------+--------------------+
.

  5) Failure:
ExplainTest#test_relation_explain_with_last [/usr/local/bundle/bundler/gems/rails-f31b853267ba/activerecord/test/cases/explain_test.rb:107]:
Expected /EXEC\ sp_executesql\ N'SELECT\ \[cars\]\.\*\ FROM\ \[cars\]\ ORDER\ BY\ \[cars\]\.\[id\]\ DESC\ OFFSET\ 0\ ROWS\ FETCH\ NEXT\ @0\ ROWS\ ONLY',\ N'@0\ int',\ @0\ =\ 1/ to match EXPLAIN for: SELECT [cars].* FROM [cars] ORDER BY [cars].[id] DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY [["LIMIT", 1]]
+----------------------------------------------------+--------+--------+--------+----------------------+----------------------+----------------------------------------------------+----------------------------------------------------+--------------+------------+-------------+------------+------------------+----------------------------------------------------+----------+----------+----------+--------------------+
| StmtText                                           | StmtId | NodeId | Parent | PhysicalOp           | LogicalOp            | Argument                                           | DefinedValues                                      | EstimateRows | EstimateIO | EstimateCPU | AvgRowSize | TotalSubtreeCost | OutputList                                         | Warnings | Type     | Parallel | EstimateExecutions |
+----------------------------------------------------+--------+--------+--------+----------------------+----------------------+----------------------------------------------------+----------------------------------------------------+--------------+------------+-------------+------------+------------------+----------------------------------------------------+----------+----------+----------+--------------------+
| SELECT [cars].* FROM [cars] ORDER BY [cars].[id... | 1      | 1      | 0      | NULL                 | NULL                 | 1                                                  | NULL                                               | 1.0          | NULL       | NULL        | NULL       | 0.00328320       | NULL                                               | NULL     | SELECT   | false    | NULL               |
|   |--Top(TOP EXPRESSION:((1)))                     | 1      | 2      | 1      | Top                  | Top                  | TOP EXPRESSION:((1))                               | NULL                                               | 1.0          | 0.0        | 1.00000001  | 4072       | 0.00328320       | [activerecord_unittest].[dbo].[cars].[id], [act... | NULL     | PLAN_ROW | false    | 1.0                |
|        |--Clustered Index Scan(OBJECT:([activer... | 1      | 3      | 2      | Clustered Index Scan | Clustered Index Scan | OBJECT:([activerecord_unittest].[dbo].[cars].[P... | [activerecord_unittest].[dbo].[cars].[id], [act... | 1.0          | 0.00312500 | 0.00015920  | 4072       | 0.00328309       | [activerecord_unittest].[dbo].[cars].[id], [act... | NULL     | PLAN_ROW | false    | 1.0                |
+----------------------------------------------------+--------+--------+--------+----------------------+----------------------+----------------------------------------------------+----------------------------------------------------+--------------+------------+-------------+------------+------------------+----------------------------------------------------+----------+----------+----------+--------------------+
.

@aidanharan aidanharan marked this pull request as ready for review May 20, 2024 11:15
@aidanharan aidanharan merged commit f3b83d0 into main May 20, 2024
2 of 8 checks passed
@aidanharan aidanharan deleted the coerce-explain-tests branch May 20, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant